#include "NistTest.h"
#include <vector>
#include <string>

double NistTest::pi; //calculated by the monbit test, some other tests need this value as well.
bool* NistTest::bitArray;
int NistTest::bitArraySize;

NistTest::NistTest(bool* bitArray, int bitArraySize)
{
	std::string testName = "unspecified Nist Test";

	//check if the static variables where already set or not
	if (this->bitArray == NULL || this->bitArraySize == 0)
	{
		this->bitArray = bitArray;
		this->bitArraySize = bitArraySize;
	}
	p_value = 0.0;
}

void NistTest::printResults() {

	for (unsigned int i = 0; i<p_values.size(); i++) {
		std::cout << "(" << i + 1 << ")" << NistTest::testName  << " P_value: " << p_values[i] << '\n';
	}
}

void NistTest::addResult(double new_p_value) {
	this->p_values.push_back(new_p_value);
}